package cn.webrx;


import java.io.File;
import java.io.RandomAccessFile;

public class Ex8 {
    public static void main(String[] args) {

        try(var is = new RandomAccessFile(new File("mysrc.txt"), "rw")){
            is.seek(7);
            byte[] buf = new byte[50];
            int len = is.read(buf);
            is.seek(7);
            is.write("java".getBytes());
            is.write(buf,0,len);
        }catch(Exception e){

        }

    }
}
